<template>
	<component :is="tag" :class="iconfont" icon v-html="code" :style="{ fontSize: size ? `${size}px` : 'inherit' }"
		@click.prevent="$emit('click', $event)" />
</template>

<script>
import VueTypes from 'vue-types'

export default {
	name: 'cy-icon',
	props: {
		tag: VueTypes.string.def('i'),
		gradient: VueTypes.string.def(''),
		size: VueTypes.number.def(0),
		iconfont: VueTypes.string.def('cyicon'),
		code: VueTypes.string
	},
	emits: ['click']
}
</script>